Graph Theory
Eulerian Trails
If the graph has the property that for any two vertices and , one can find a path from and , then we say that is a connected graph.
If a graph has no loops and has no multiple edges between the same pair of points, then we will say that is a simple graph.
A sequence of distinct edges is called a trail if we can take a continuous walk in our graph. A walk is like a trail, except that all edges do not need to be distinct.
If a trail uses all edges of , then we call it an Eulerian trail. If a trail does not touch any vertex twice, then we call it a path.
Theorem
A connected graph has a closed Eulerian trail if and only if all vertices of have an even degree.
Proof
First, we prove the "only if" part, that is, we show that if has a closed Eulerian trail, then all vertices of must have an even degree. Indeed, when we take the closed Eulerian trail , we visit each vertex a certain number of times. Let be a vertex that was not where started, and assume we visited exactly times. This means we entered exactly times, and we left exactly times. As we assumed was a trail, we had to do this using different edges, so we used edges. On the other hand, contains all edges of , so cannot have any additional edges, therefore the degree of is . This shows that the degree of any vertex other than the starting point of is even. Finally, note that is not only the starting point of , but also the endpoint, so if we visit exactly times between the start and the end of , then we use edges. Therefore, the degree of is , and our claim is proved.
Now let us assume that all vertices of have an even degree and prove that has a closed Eulerian trail. Take any vertex , and start walking along an edge , to the other endpoint of that edge, then walk along any new edge that starts in . Continue this way, using new (previously unused) edges at each step, until a closed trail is formed. As is finite, such a closed trail will always be formed. The first closed trail will be formed when we first revisit a vertex already visited. We cannot get stuck at some vertex before completing a closed trail as each vertex has an even degree, so each time we enter a vertex, we can also leave it, except possibly the initial vertex. If , then we are done. If not, then choose a vertex in so that does not contain all edges adjacent to .
The alert reader can ask now how we know that there is such a vertex . Let us assume that there is not. As contains fewer edges than , and supposedly contains all edges adjacent to all vertices it contains, there must be a vertex that is not in . However, is a connected graph, so there must be a path connecting to any vertex in . Start walking on this path from to any given vertex of . When you reach the first time, you will reach it in a vertex that is in , but not all the edges adjacent to it are in . Indeed, the one that has just ended in is not. This proves by contradiction that such a vertex always exists. Illustrated here:
Let us now remove all edges of from . We get a graph in which again all vertices have an even degree. Starting at , let us take another closed trail in the remaining graph. We can then unite and into one closed trail in . Indeed, if we start walking by , we can stop at , walk through , then complete our trail by using the remaining part of . If the new trail contains all edges of , we are done. If not, then let us omit from , and find a new closed trail in the remaining graph.
As has a finite number of edges, this procedure has to stop after a finite number of steps. Therefore, after a finite number of steps, will be a closed trail containing all edges of .
Hamiltonian Cycles
A cycle in a graph is a closed trail that does not touch any vertex twice, except, the initial vertex, which must also be the ending vertex. A cycle that includes all vertices of a graph is called a Hamiltonian path.
Theorem
Let , let be a simple graph on vertices, and let us assume that all vertices in are of degree at least . Then has a Hamiltonian cycle.
Proof
Note that it follows from the conditions that is connected. Indeed, if had more than one component, then it would have a component of less than vertices, and vertices in that component would have a degree less than .
Let us assume that does not have a Hamiltonian cycle. Let us add new edges to as long as we can without creating a Hamiltonian cycle. When we stop, we have a graph in which all vertices have a degree at least , there is no Hamiltonian cycle, but adding any new edge would create a Hamiltonian cycle.
Let be a path of maximum length in . We claim that contains all vertices of . Indeed let and be two vertices in that are not connected by an edge. As adding the edge would create a Hamiltonian cycle, it follows that has a Hamiltonian path that starts at and ends .
Let be the vertices of this path, from to . Vertices and together have at least neighbors. Therefore, the Pigeon-hole Principle implies that there must be an index so that , while is an edge, and also, is an edge. (Otherwise the set of neighbors of and the set of vertices that immediately precede a neighbor of on the -path would be disjoint, which is impossible since these sets are too large.) This is a contradiction, however, for this would mean that is a Hamiltonian cycle as shown below.
Directed Graphs
A graph in which each edge is assigned a direction is called a directed graph or digraph.
Theorem 1
A directed graph has a closed Eulerian trail if and only if it is balanced and strongly connected.
Proof
First, we prove that these conditions are necessary. As a closed Eulerian trail leaves each vertex as many times as it enters that vertex, must be balanced. Similarly, provides a trail from any vertex to any vertex, so is strongly connected.
Theorem 2
All tournaments have a Hamiltonian path. Proof. We prove the claim by induction on , the number of vertices of our tournament . If has one, or two vertices, then the statement is clearly true. Now assume that we know the statement for all tournaments having vertices. Let be any tournament on vertices. Separate any vertex , and call the remaining graph on vertices . By the induction hypothesis, has a Hamiltonian path . The question is how we can insert into . If there is an index so that is an edge and is an edge, then we can insert between and . If no such exists, then there must exist an index so that , and for all is an edge, and for all is an edge. Therefore, either is an edge, or is an edge. So we can affix either to the front or to the end of .
Theorem 3
A tournament has a Hamiltonian cycle if and only if it is strongly connected.
Proof
If has a Hamiltonian cycle, then that cycle provides a directed path from any vertex to any vertex, so is strongly connected.
Now let us assume that is strongly connected, and let denote the set of edges of . First, we prove that does contain a cycle. Indeed, if it did not, then and would imply , so would be a transitive tournament. In such a tournament, the vertices can be listed from left to right so that if and only if is on the right of . However, such a tournament is not strongly connected as no paths go to the right. So does have a cycle.
Let be a cycle of maximal length in , and assume is not a Hamiltonian cycle. As is strongly connected, it contains an edge from to some vertex that is not in . We can assume without loss of generality that this edge is . If were an edge, then would be a cycle having more vertices than . Therefore, has to be an edge, and then similarly, must all be edges.
Let be the set of all vertices so that . Then for all and all by the same argument as the one we applied for in the previous paragraph. Let be an edge, with , and . Such an edge exists as is strongly connected. Then , and therefore implies that . Then, however, is a longer cycle than . The figure below shows our construction. This contradiction completes the proof.
Isomorphisms
We say that graphs and are isomorphic if there is a bijection from the vertex set of onto that of so that the number of edges between any pair of vertices and of is equal to the number of edges between vertices and of . The bijection is called an isomorphism.